/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package GameObject;
import java.awt.*;
import java.awt.Graphics2D;
import java.util.Timer;
/**
 *
 * @author Shadel
 */
public class Sprite 
{
    public int _x;
    public int _y;
    public int _width;
    public int _height;
    public Image[] _images;
    public int _selectedIndex;
    
    public Sprite(int x,int y,int w,int h,Image[] a_imgs)
    {
        _x = x;
        _y = y;
        _width = w;
        _height = h;
        _images = a_imgs;
        _selectedIndex = 0;
    }
    
    public void update(Timer gameTime)
    {
    }
    
    public void update(Timer gameTime,int x,int y,int w,int h,int i_selected)
    {
        _x = x;
        _y = y;
        _width = w;
        _height = h;
        _selectedIndex = i_selected;
    }
    
    public void update(int x,int y,int w,int h,int i_selected)
    {
        _x = x;
        _y = y;
        _width = w;
        _height = h;
        _selectedIndex = i_selected;
    }
    public void Draw(Timer gameTime,Graphics2D graphic)
    { 
        //g2d = a_images[state].createGraphics();
        Image img = _images[_selectedIndex].getScaledInstance(_width, _height,Image.SCALE_SMOOTH);
        graphic.drawImage(img, this._x, this._y,_width,_height,null,null);
        //graphic.drawImage(img, X, Y ,width,height,null,null);
    }
}
